<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: cameraPTZExample.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('cameraPTZExample_8cpp-example.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">cameraPTZExample.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<p>This is an example showing how to connect to and use a camera's PTZ control (or DPPTU)This program can control PTZ cameras with support built in to the ARIA library: Canon VCC 4/5, Sony PTZ, RVision, and DPPTU. To control the Axis network cameras, see example programs in the ArVideo library instead.</p>
<p>PTZ type and connection parameters are read from robot parameter file if available, or use command-line arguments to override the robot parameter file. Run with &ndash;help for a complete list of command-line options available.</p>
<p>For example, to connect to Canon VCC on robot auxilliary serial port, use: ./cameraPTZExample -ptzType vcc4</p>
<p>To connect to Canon VCC on serial port COM4, use: ./cameraPTZExample -ptzType vcc4 -ptzSerialPort COM4 or on Linux this works too: ./cameraPTZExample -ptzType vcc4 -ptzSerialPort /dev/ttyS3</p>
<p>To connect to RVision camera, use: ./cameraPTZExample -ptzType rvision</p>
<p>To connect to DPPTU use: ./cameraPTZExample -ptzType dpptu</p>
<p>Canon VCC defaults to use the microcontroller port Aux1. Use -ptzRobotAuxSerialPort or -ptzSerialPort arguments to change.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;Aria.h&quot;</span></div><div class="line"><span class="comment">//#include &quot;ArVideo.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)</div><div class="line">{</div><div class="line">  <a name="a0"></a><a class="code" href="classAria.html#ad99c16b5d947229d9f8e1c5b2d4cdd73">Aria::init</a>();</div><div class="line">    <span class="comment">//ArVideo::init();</span></div><div class="line"><span class="comment">//  ArLog::init(ArLog::StdOut, ArLog::Verbose);</span></div><div class="line">  <a name="_a1"></a><a class="code" href="classArArgumentParser.html">ArArgumentParser</a> parser(&amp;argc, argv);</div><div class="line">  parser.<a name="a2"></a><a class="code" href="classArArgumentParser.html#a501694b62a7f8b0c3cadd84aeafe1b35">loadDefaultArguments</a>();</div><div class="line">  <a name="_a3"></a><a class="code" href="classArRobot.html">ArRobot</a> robot;</div><div class="line">  <a name="_a4"></a><a class="code" href="classArRobotConnector.html">ArRobotConnector</a> robotConnector(&amp;parser, &amp;robot);</div><div class="line"></div><div class="line">  <span class="comment">// This is used to create and configure the PTZ interface object based on the</span></div><div class="line">  <span class="comment">// robot&#39;s parameter file and this program&#39;s command line options (run with</span></div><div class="line">  <span class="comment">// -help for list). Must be created before calling Aria::parseArgs().</span></div><div class="line">  <a name="_a5"></a><a class="code" href="classArPTZConnector.html">ArPTZConnector</a> ptzConnector(&amp;parser, &amp;robot);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span>(!robotConnector.<a name="a6"></a><a class="code" href="classArRobotConnector.html#ab192ac393d9cc1e5b61b1a82b08d085d">connectRobot</a>())</div><div class="line">  {</div><div class="line">    <a name="a7"></a><a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a name="a8"></a><a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a012daf6573594f91242f8dd7c02eb74b">ArLog::Terse</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning, Could not connect to the robot. Won&#39;t use robot parameter file for defaults&quot;</span>);</div><div class="line">  }</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span> (!<a name="a9"></a><a class="code" href="classAria.html#a1b090c01d88bb420b8cf8e0384d25ee1">Aria::parseArgs</a>() || !parser.<a name="a10"></a><a class="code" href="classArArgumentParser.html#ac3889cbdfa862031c51bf80e06954914">checkHelpAndWarnUnparsed</a>())</div><div class="line">  {</div><div class="line">    <a name="a11"></a><a class="code" href="classAria.html#a10d71f3d4d0cf7f38c58a1f749f64a42">Aria::logOptions</a>();</div><div class="line">    <a name="a12"></a><a class="code" href="classAria.html#a6abc3d39b3e9548063bb8e78375acc17">Aria::exit</a>(1);</div><div class="line">  }</div><div class="line"></div><div class="line">  <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a name="a13"></a><a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Connected.&quot;</span>);</div><div class="line"></div><div class="line">  robot.<a name="a14"></a><a class="code" href="classArRobot.html#a3c3d878cfd11a2ef91230005a83bfcaa">runAsync</a>(<span class="keyword">true</span>);</div><div class="line"></div><div class="line">  <span class="comment">// Create and connect to all PTZs given in robot parameter file and command</span></div><div class="line">  <span class="comment">// line.</span></div><div class="line">  <span class="keyword">const</span> <span class="keywordtype">int</span> PauseTime = 3500; <span class="comment">// ms</span></div><div class="line">  ptzConnector.<a name="a15"></a><a class="code" href="classArPTZConnector.html#ac360c671ec7b96639bc9e73b166d0f7b">connect</a>();</div><div class="line">  <a name="a16"></a><a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime*2);</div><div class="line">  <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 0; i &lt; ptzConnector.<a name="a17"></a><a class="code" href="classArPTZConnector.html#a581670a703c3f1e1c99fcaa53c95c554">getNumPTZs</a>(); ++i)</div><div class="line">  {</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: [getPTZ(%d)..]&quot;</span>, i);</div><div class="line"></div><div class="line">    <a name="_a18"></a><a class="code" href="classArPTZ.html">ArPTZ</a> *ptz = ptzConnector.<a name="a19"></a><a class="code" href="classArPTZConnector.html#a3b7815ff4ba358b80eee7ca1a7e46ad7">getPTZ</a>(i);</div><div class="line">    <span class="keywordflow">if</span>(!ptz)</div><div class="line">    {</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: there is no PTZ %d.&quot;</span>, i+1);     </div><div class="line">      <span class="keywordflow">continue</span>;</div><div class="line">    }</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: ===== PTZ #%d is a %s =====&quot;</span>, i+1, ptz-&gt;<a name="a20"></a><a class="code" href="classArPTZ.html#a1b638f8a180e0b66ae52b9b1ef949f42">getTypeName</a>());</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan left -90..&quot;</span>);</div><div class="line">    ptz-&gt;<a name="a21"></a><a class="code" href="classArPTZ.html#a284e5582d1b05baa961463c8a8198de3">pan</a>(-90);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan position is now %f (%s).&quot;</span>, ptz-&gt;<a name="a22"></a><a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), (ptz-&gt;<a name="a23"></a><a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), -90, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: pan position is more than one degree different from command -90.&quot;</span>);</div><div class="line">      </div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan right 90..&quot;</span>);</div><div class="line">    ptz-&gt;<a class="code" href="classArPTZ.html#a284e5582d1b05baa961463c8a8198de3">pan</a>(90);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan position is now %f. (%s)&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), 90, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: pan position is more than one degree different from command 90.&quot;</span>);</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan center 0..&quot;</span>);</div><div class="line">    ptz-&gt;<a class="code" href="classArPTZ.html#a284e5582d1b05baa961463c8a8198de3">pan</a>(0);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan position is now %f (%s).&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), 0, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: pan position is more than one degree different from command 0.&quot;</span>);</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt up 90..&quot;</span>);</div><div class="line">    ptz-&gt;<a name="a24"></a><a class="code" href="classArPTZ.html#a924db75e9b7739125ea6ca9cc1dae9a3">tilt</a>(90);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt position is now %f(%s).&quot;</span>, ptz-&gt;<a name="a25"></a><a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), 90, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: tilt position is more than one degree different from command 90.&quot;</span>);</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt down -20..&quot;</span>);</div><div class="line">    ptz-&gt;<a class="code" href="classArPTZ.html#a924db75e9b7739125ea6ca9cc1dae9a3">tilt</a>(-20);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt position is now %f(%s).&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), -20, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: tilt position is more than one degree different from command -20.&quot;</span>);</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt center 0..&quot;</span>);</div><div class="line">    ptz-&gt;<a class="code" href="classArPTZ.html#a924db75e9b7739125ea6ca9cc1dae9a3">tilt</a>(0);</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt position is now %f (%s).&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <span class="keywordflow">if</span>(!ArMath::compareFloats(ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), 0, 1))</div><div class="line">      <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Warning: tilt position is more than one degree different from command 0.&quot;</span>);</div><div class="line"></div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Reset..&quot;</span>);</div><div class="line">    ptz-&gt;<a name="a26"></a><a class="code" href="classArPTZ.html#a5b4a5e0245ea974434fac47e07b32be8">reset</a>();</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Pan position is now %f (%s).&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#a9d76370937c1cb2170e7a07a0157d949">getPan</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Tilt position is now %f (%s).&quot;</span>, ptz-&gt;<a class="code" href="classArPTZ.html#ae9f4ff90958537f6bdc095e9ed12ebe6">getTilt</a>(), (ptz-&gt;<a class="code" href="classArPTZ.html#a9dc961e4c30c2bb0416738aeadbe91f5">canGetRealPanTilt</a>()?<span class="stringliteral">&quot;real position from camera&quot;</span>:<span class="stringliteral">&quot;last command sent&quot;</span>));</div><div class="line">    <a class="code" href="group__easy.html#ga4dfb878a3f9123b8dd96ae05b2fd94cb">ArUtil::sleep</a>(PauseTime);</div><div class="line">  }</div><div class="line"></div><div class="line">  <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Ending robot thread..&quot;</span>);</div><div class="line">  robot.<a name="a27"></a><a class="code" href="group__easy.html#gaff02cf7043c2e7239ec6b6e11ff6b146">stopRunning</a>();</div><div class="line"></div><div class="line">  <span class="comment">// wait for the thread to stop</span></div><div class="line">  robot.<a name="a28"></a><a class="code" href="group__easy.html#ga95201be7c39b521983b51e6f5d9303e4">waitForRunExit</a>();</div><div class="line"></div><div class="line">  <span class="comment">// exit</span></div><div class="line">  <a class="code" href="classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="code" href="classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;cameraPTZExample: Exiting.&quot;</span>);</div><div class="line">  <a class="code" href="classAria.html#a6abc3d39b3e9548063bb8e78375acc17">Aria::exit</a>(0);</div><div class="line">  <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
